import ruleOpt from '@/biz/option/rule.js'
import uploadOpt from '@/biz/option/upload.js'
let _this = null

function options(vm) {
  _this = vm
  let arr = [
    {
      title: '资料类型',
      key: 'dataType',
      placeholder: '请选择资料类型',
      select: { key: 'housesDataType' },
      rules: [ruleOpt.required('请选择资料类型', 'string')]
    },
    {
      title: '内容',
      key: 'content',
      placeholder: '请填写资料内容',
      input: { maxlength: 200 },
      rules: [ruleOpt.required('请填写资料内容', 'string')]
    },
    uploadOpt.fileOss(
      {
        title: '附件',
        placeholder: '(最大支持50M文件，若文件过大请压缩或分多个文件)',
        key: 'attachList',
        maxlength: 10,
        hideDel: false,
        show: false,
        maxSize: 51200,
        showDel: true,
        multiple: true,
        itemName: 'imageName',
        itemUrl: 'imageURL',
        rules: [ruleOpt.required('请上传资料附件', 'array')]
      },
      _this.info
    )
  ]

  return arr
}

export default {
  options
}
